package com.bbird.od.finance.service.models;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author ziyang Kuang
 * @date 2021/4/18
 * @describe
 */

@Data
public class DYBankFLow extends BankFlow {

    @ExcelProperty("订单号")
    private String orderNumber;

    // 用于判断末行
    @ExcelIgnore
    private String businessOrderNumber;

    @ExcelProperty("订单实付(元)")
    private BigDecimal orderActuallyPaid = BigDecimal.ZERO;

    @ExcelProperty("平台补贴(元)")
    private BigDecimal platformSubsidy = BigDecimal.ZERO;

    @ExcelProperty("订单退款(元)")
    private BigDecimal refundAmount = BigDecimal.ZERO;

    @Override
    public BigDecimal getActualAmount() {
        if (orderActuallyPaid != null && platformSubsidy != null) {
            return orderActuallyPaid.add(platformSubsidy);
        }
        return BigDecimal.ZERO;
    }

    /**
     * 用于判断末行
     */
    public String getBusinessOrderNumber() {
        return this.orderNumber;
    }

    @Override
    public String getHomeOrderNumber() {
        return this.orderNumber;
    }
}
